<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
    <title>基础数据平台</title>
    <link rel="stylesheet" href="../../static/js/plug-in/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="../../static/js/plug-in/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="../../static/js/plug-in/dist/css/AdminLTE.css"/>
    <link rel="stylesheet" href="../../static/js/plug-in/dist/css/skins/_all-skins.min.css"/>
    <!--[if lt IE 9]>
    <script src="../../static/js/public/html5shiv.min.js"></script>
    <script src="../../static/js/public/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" href="../../static/css/public/public.css" />
    <link rel="stylesheet" href="../../static/js/plug-in/my-form-prompt/css/form-prompt.css">
    <link rel="stylesheet" href="../../static/js/plug-in/jqueryConfirm/css/jquery-confirm.min.css" />
     <link rel="stylesheet" href="../../static/js/plug-in/jstree/css/style.min.css" />
</head>

<body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
       <header class="main-header" id="_header"></header>
        <aside class="main-sidebar" id="_left"></aside>

        <div class="content-wrapper">
            <section class="content-header">
                <h1>用户权限</h1>
                <ol class="breadcrumb">
                    <li>
                        <a href="index.html"><i class="fa fa-dashboard"></i>首页</a>
                    </li>
                    <li>
                        <a href="jurisdiction-org.html">权限管理</a>
                    </li>
                    <li>
                        <a href="jurisdiction-user.html">用户权限</a>
                    </li>
                </ol>
            </section>
            <section class="content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="box">
                            <div class="box-header">
                                <div class="row">   
                                    <ul class="col-xs-8 nav navbar-nav">
                                        <li class="pull-left">
                                            <a class="j-role-add" href="#" onclick="addOrEdit(0);">创建新角色</a>
                                        </li>
                                    </ul>
                                    
                                    <form class="col-xs-3 pull-right">
                                        <div class="input-group">
                                            <input type="text" class="form-control" placeholder="" />
                                            <span class="input-group-btn">
                                                <button class="btn btn-info" type="button">搜索</button>
                                            </span>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div class="box-body">
                                <table class="table table-bordered table-hover table-condensed table-striped text-center" id="j-table-1">
                                    <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>角色名</th>
                                        <th>描述</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="_roles">
                                    <tr>
                                        <td>12315</td>
                                        <td>雅典娜</td>
                                        <td>110</td>
                                        <td>教研室</td>
                                        <td>教师</td>
                                        <td>可用</td>
                                        <td>
                                            <button type="button" class="btn btn-success btn-xs j-jur">权限</button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div id="fenye"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>










        <footer class="main-footer" id="_footer"></footer>
        <div class="control-sidebar-bg"></div>
    </div>

	<!--添加模板-->
	<div class="modal fade in" id="Modal-role-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">添加角色</h4>
                </div>
                <div class="modal-body col-xs-12">
                    <div class="form-horizontal">
                    	<input type="hidden"  id="rid" value="0"/>
                        <div class="form-group">
                            <label for="input-name" class="col-sm-2 control-label"><span class="my-red">*</span>角色名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="input-roleName" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-name" class="col-sm-2 control-label">描述</label>
                            <div class="col-sm-10" form-prompt="false" form-prompt-text="名称为1~20位">
                                <input type="text" class="form-control" id="input-roleDesc" placeholder="名称为1~20位" value="">
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">状态</label>
                            <div class="col-sm-9">
                                <label class="my-form-radio">
                                	启用<input type="radio" name="status" id="input-state-1" checked="checked"  value="1">
                                </label>
                                <label class="my-form-radio">
                                	禁用<input type="radio" name="status" id="input-state-2" value="0">
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary j-confirm-btn" onclick="_submit();">确定</button>
                </div>
            </div>
        </div>
    </div>
    
    <!--添加角色菜单权限模板-->
    <div class="modal fade in" id="Modal-menu-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-menu-title">添加角色</h4>
                </div>
                <div class="modal-body col-xs-12">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label for="input-name" class="col-sm-2 control-label"><span class="my-red">*</span>角色名</label>
                            <div class="col-sm-10">
                            	<input type="hidden" class="form-control" id="input-roleId1" >
                                <input type="text" class="form-control" id="input-roleName1" readonly="readonly">
                            </div>
                        </div>
                       
                       <div class="form-group">
                     	    <label for="input-name" class="col-sm-2 control-label">可选菜单</label>
	                        <!--<div class="col-sm-10">
	                            <input type="text" class="form-control" id="input-roleName1" >
	                        </div>-->
	                        <div class="col-sm-10 my-treeview-mn ">
	                            <div id="treeview2" class="treeview"></div>
	                        </div>
                       </div>
                        
                       
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary j-confirm-btn" id="menusubmit">确定</button>
                </div>
            </div>
        </div>
    </div>
</body>
<!--[if IE 9]>
<script src="../../static/js/plug-in/jquery/jquery-1.11.0.js"></script>
<![endif]-->
<script src="../../static/js/plug-in/jquery/jquery-2.2.3.min.js"></script>
<script src="../../static/js/externalr.js"></script>  
<script src="../../static/js/plug-in/bootstrap/js/bootstrap.min.js"></script>
<script src="../../static/js/plug-in/dist/js/app.min.js"></script>
<script src="../../static/js/plug-in/dist/js/demo.js"></script>
<script src="../../static/js/public/public.js"></script>
<script src="../../static/js/plug-in/jstree/js/jstree.min.js"></script>
<link rel="stylesheet" href="../../static/js/layui/css/layui.css">
<script src="../../static/js/jquery.tmpl.min.js"></script>
<script  src="../../static/js/layui/layui.js"></script>
<script src="../../static/js/utils.js"></script>
<script src="../../static/js/role/role-user.js"></script>
<script id="rlesTemplate" type="text/x-jquery-tmpl">
{{each(i,item) roles}}
    <tr>
        <td>{{= item.id}}</td>
        <td>{{= item.roleName}}</td>
        <td>{{= item.roleDesc}}</td>
        <td> 
        	{{if item.status==1}}
            	启用
        	{{else}}
           		禁用
           	{{/if}}
        </td>
        <td>
            <button type="button" class="btn btn-info btn-xs j-jur" onclick="addOrEdit({{= item.id}})">编辑</button>
            <button type="button" class="btn btn-success btn-xs j-jur" onclick="addmenu({{= item.id}},'{{= item.roleName}}')" onload="">权限</button>
            <button type="button" class="btn btn-danger btn-xs j-jur" onclick="delRole({{= item.id}})">删除</button>
        </td>
    </tr>
{{/each}}
</script>
</html>